﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    EnableEventValidation="false" CodeBehind="ControlesGestionar.aspx.cs" Inherits="AudiPyme.UI.ControlesGestionar"  %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:Panel ID="PanelAdministrador" runat="server">
        <ul class="list1">
            <li><a href="ControlesPrincipal.aspx">Controles Principal</a></li>
            <li><a href="EmpresaNivMadurezPrincipal.aspx">Nivel Madurez Principal</a></li>
        </ul>
    </asp:Panel>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <h2>
        Gestionar Controles
    </h2>
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <script type="text/javascript">
        function expandDetailsInGrid(_this) {
            var id = _this.id;
            var imgelem = document.getElementById(_this.id);
            var currowid = id.replace("A_View", "TR_Summmary") //Coge el Id la fila seleccionada

            var rowdetelemid = currowid;
            var rowdetelem = document.getElementById(rowdetelemid);
            if (imgelem.alt == "plus") {
                imgelem.src = "/Images/minus.gif"
                imgelem.alt = "minus"
                rowdetelem.style.display = 'block';
            }
            else {
                imgelem.src = "/Images/plus.gif"
                imgelem.alt = "plus"
                rowdetelem.style.display = 'none';
            }

            return false;

        }
    </script>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <asp:Panel ID="PnlGV" runat="server" Visible="True">
                <asp:GridView ID="GVControles" runat="server" AutoGenerateColumns="False" AllowPaging="True"
                    OnPageIndexChanging="GridView1_PageIndexChanging" BackColor="White" BorderColor="#CCCCCC"
                    BorderStyle="None" BorderWidth="1px" CellPadding="3">
                    <Columns>
                        <asp:TemplateField>
                            <ItemTemplate>
                                <asp:ImageButton ID="A_View" runat="server" AlternateText="plus" ImageUrl="~/Images/plus.gif"
                                    OnClientClick="expandDetailsInGrid(this);return false;" />
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:BoundField DataField="IdControl" HeaderText="IdControl" ReadOnly="true" />
                        <asp:BoundField DataField="Codigo" HeaderText="Codigo" ReadOnly="true" />
                        <asp:BoundField DataField="Nombre" HeaderText="Nombre" ReadOnly="true" />
                        <asp:TemplateField HeaderText="Opciones">
                            <ItemTemplate>
                                <asp:RadioButtonList ID="RadioButtonList1" runat="server" witdh="auto" AutoPostBack="true"
                                    OnSelectedIndexChanged="Index_Changed">
                                    <asp:ListItem Value="SI">SI</asp:ListItem>
                                    <asp:ListItem Value="NO">NO</asp:ListItem>
                                    <asp:ListItem Value="PARCIALMENTE">PARC</asp:ListItem>
                                    <asp:ListItem Value="NO APLICA">N/A</asp:ListItem>
                                </asp:RadioButtonList>
                                </td> </tr>
                                <tr id="TR_Summmary" runat="server" style="display: none">
                                    <td colspan="7">
                                        <table>
                                            <tr>
                                                <td>
                                                </td>
                                                <td>
                                                    <asp:Label ID="Label1" runat="server" Text='<%#Eval("Descripcion")%>'></asp:Label>
                                                </td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                    <FooterStyle BackColor="White" ForeColor="#000066" />
                    <HeaderStyle BackColor="#006699" Font-Bold="True" ForeColor="White" />
                    <PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Left" />
                    <RowStyle ForeColor="#000066" />
                    <SelectedRowStyle BackColor="#669999" Font-Bold="True" ForeColor="White" />
                    <SortedAscendingCellStyle BackColor="#F1F1F1" />
                    <SortedAscendingHeaderStyle BackColor="#007DBB" />
                    <SortedDescendingCellStyle BackColor="#CAC9C9" />
                    <SortedDescendingHeaderStyle BackColor="#00547E" />
                </asp:GridView>
                <br />
                <asp:Button ID="BtnInsertar" runat="server" Text="Actualizar" OnClick="BtnInsertar_Click" />
            </asp:Panel>
        </ContentTemplate>
    </asp:UpdatePanel>
    <br />
</asp:Content>
